import request from '@/api/request';

/**
 * 所有省市区信息
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
 export const regionListAllApi = query => {
    return request({
        url: '/api/setup/region/listAll',
        method: 'get',
        params: query,
        isLoading: true
    });
};

/**
 * 启用的列表
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const regionListEnabledApi = query => {
    return request({
        url: '/api/setup/region/listEnabled',
        method: 'get',
        params: query,
        isLoading: true
    });
};

/**
 * 详情
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
 export const regionDetailApi = query => {
    return request({
        url: '/api/setup/region/getDetail',
        method: 'get',
        params: query,
        isLoading: true
    });
};

/**
 * 添加
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const regionSaveApi = query => {
    return request({
        url: '/api/setup/region/save',
        method: 'post',
        data: query,
        isLoading: true
    });
};

/**
 * 编辑
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const regionEditApi = query => {
    return request({
        url: '/api/setup/region/edit',
        method: 'put',
        data: query,
        isLoading: true
    });
};

/**
 * 删除
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const regionRemoveApi = query => {
    return request({
        url: '/api/setup/region/removeByIds',
        method: 'delete',
        params: query,
        isLoading: true
    });
};
